export const getFeeder_State = (state, data) => {
   
  if(state.ToRender.length == 20){
    state.ToRender = []
  }
  if(state.RunningChart_State.series[0].data.length > 20){
    state.RunningChart_State.series[0].data = state.RunningChart_State.series[0].data.slice(0,15)
  }
  state.RunningChart_State.series[0].data.unshift(Number(data.valu[0].v) );
  state.ToRender.unshift(Number(data.valu[0].v) );
  

  //  判断送料件是否正常工作
  if (data.valu[0].v == 0) {
    // 当值为0表示没有材料
    state.Feeder_State.hint.maintain = "送料机没有材料";
  } else {
    state.Feeder_State.hint.maintain = "送料机材料运输中";
    if (data.valu[4].v == 0) {
      return (state.Feeder_State.hint.error = "产品定位异常,请检查！！！");
    } else {
      state.Feeder_State.hint.error = "产品定位正常！！！";
    }
    if (data.valu[5].v == 0) {
      // console.log("异常2");
      return (state.Feeder_State.hint.error =
        "产品厚度不符合！！！请检查！！！");
    } else {
      state.Feeder_State.hint.error = "产品厚度符合！！！";
    }
    if (data.valu[6].v == 1) {
      // console.log("异常3");
      return (state.Feeder_State.hint.error =
        "产品厚度不符合！！！请检查！！！");
    } else {
      state.Feeder_State.hint.error = "产品厚度符合！！！";
    }
  }

  if (data.valu[1].v == 0) {
    state.Feeder_State.hint.instruct = "送料机送料完成";
  } else {
    state.Feeder_State.hint.instruct = "送料机材料运输中";
  }
  // 判断送料机是否异常
  if (data.valu[3].v == 1) {
    state.Feeder_State.isactive = true;
    state.Feeder_State.img = require("../../assets/images/feed01-fault.gif");
    if (data.valu[4].v == 0) {
      return (state.Feeder_State.hint.error = "产品定位异常,请检查！！！");
    } else {
      state.Feeder_State.hint.error = "产品定位正常！！！";
    }
    if (data.valu[5].v == 0) {
      // console.log("异常2");
      return (state.Feeder_State.hint.error =
        "产品厚度不符合！！！请检查！！！");
    } else {
      state.Feeder_State.hint.error = "产品厚度符合！！！";
    }
    if (data.valu[6].v == 1) {
      // console.log("异常3");
      return (state.Feeder_State.hint.error =
        "产品厚度不符合！！！请检查！！！");
    } else {
      state.Feeder_State.hint.error = "产品厚度符合！！！";
    }
  } else {
    state.Feeder_State.img = require("../../assets/images/feed01.png");
  }

 
};
